﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

namespace Project_1.Models
{
    public class Notification
    {
        public int Id { get; set; }
	    public string Content { get; set; }
	    public string Username { get; set; }
	    public int QuestionId { get; set; }
	    public int AnswerId { get; set; }
	    public int Type { get; set; }
        public bool Read { get; set; }
    }

    public class NotificationConfiguration : EntityTypeConfiguration<Notification>
    {
        public NotificationConfiguration() : base()
        {
            HasKey(p => p.Id);
            Property(p => p.Id).
                HasColumnName("Id").
                HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).
                IsRequired();
            Property(p => p.Content).
                HasColumnName("Content").
                IsRequired();
            Property(p => p.Username).
                HasColumnName("Username").
                IsRequired();
            Property(p => p.QuestionId).
                HasColumnName("QuestionId").
                IsRequired();
            Property(p => p.AnswerId).
                HasColumnName("AnswerId").
                IsRequired();
            Property(p => p.Type).
                HasColumnName("Type").
                IsRequired();
            Property(p => p.Read).
                HasColumnName("Read").
                IsRequired();
            ToTable("Notifications");
        }
    }
}